import time

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

wb = webdriver.Chrome()
wb.get('file:///D:/HRJT/%E9%A1%B9%E7%9B%AE/%E4%B8%AD%E5%A4%AE%E8%B4%A2%E5%8A%A1%E7%B3%BB%E7%BB%9F/Login%E6%BC%94%E7%A4%BA%E9%A1%B5%E9%9D%A2/register.html')
# wb.get('file:///D:/HRJT/%E9%A1%B9%E7%9B%AE/%E4%B8%AD%E5%A4%AE%E8%B4%A2%E5%8A%A1%E7%B3%BB%E7%BB%9F/Login%E6%BC%94%E7%A4%BA%E9%A1%B5%E9%9D%A2/login.html')
el = wb.find_element(By.XPATH, '//*[@id="userType"]')
Select(el).select_by_index(2)

Select(el).select_by_value('1')

wb.find_element(By.XPATH, '//*[@id="loginDiv"]/form/p[5]/input[1]').click()
wb.find_elements(By.XPATH, '//*[@id="loginDiv"]/form/p[5]/input')[2].click()

wb.switch_to.frame(wb.find_element(By.ID, 'info'))
wb.find_element(By.ID, 'introduceText').send_keys('zhangsan')
wb.switch_to.default_content()

# wb.find_element(By.ID, 'submit').click()

# wb.switch_to.alert.accept()
# wb.switch_to.default_content()
time.sleep(1)
# ac = ActionChains(wb)
# ac.click_and_hold(wb.find_element(By.XPATH, '//*[@id="box"]/div[3]')).move_by_offset(100, 0).release().perform()